boolean increase = false;
int value = 500;

void setup() {
  Serial.begin(9600);
  pinMode(2, INPUT);
  digitalWrite(2, LOW);
  delay(30000);
  Serial.println("calibrated");
}

void loop() {
  if (digitalRead(2) == HIGH) {
    value++;
  } else {
    value--;
  }
  
  
  if (value < 0) {
    value = 0;
  }
  
  if (value > 255) {
    value = 255;
  }
  
  analogWrite(11, value);         
  delay(20);
}
